import Vue from 'vue'
import App from './App'
import './uni.promisify.adaptor'
import Config from '@/config.js'


Vue.config.productionTip = false


// VUEX
import Vuex from 'vuex'
import store from '@/store/index'
Vue.prototype.$store = store
// uView
import uView from "uview-ui";
Vue.use(uView)
// 如此配置即可
uni.$u.config.unit = 'rpx'

// 混入
import Mixin from '@/static/js/mixins.js';
Vue.mixin(Mixin);

// 通用函数
Vue.prototype.getImgUrl = function(img, type) {
    if (type == true) {
        return "@/static/images/" + img;
    } else {
        return Config.service.imgUrl + img;
    }
};

Vue.prototype.getCurUserID = function() {
    var curId = ""
    if (uni.getStorageSync('userType') == 1) {
        return uni.getStorageSync('employeeId') || ''
    } else {
        return uni.getStorageSync('memberId') || ''
    }
};

//==全局组件注册
import tipTimeline from "@/components/tipTimeline/index.vue"
import shareButton from "@/components/shareButton/shareButton.vue"
import popupRedPacket from '@/components/popupRedPacket/index.vue'
import popupNew from '@/components/uPopupNew/u-popup.vue'

Vue.component('tipTimeline', tipTimeline)
Vue.component('shareButton', shareButton)
Vue.component('popupRedPacket', popupRedPacket)
Vue.component('popupNew', popupNew)


App.mpType = 'app'

const app = new Vue({
  ...App
})
app.$mount()
